package org.znxs.znagent_image_search_mcp_server;

import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.znxs.znagent_image_search_mcp_server.tools.ImageSearchTool;

@SpringBootApplication
public class ZnAgentImageSearchMcpServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZnAgentImageSearchMcpServerApplication.class, args);
    }

    // 启动的时候注册为Bean
    @Bean
    public ToolCallbackProvider imageSearchTools(ImageSearchTool imageSearchTool) {
        // 使用 MethodToolCallbackProvider 构建 工具provider
        return MethodToolCallbackProvider.builder()
                .toolObjects(imageSearchTool)
                .build();
    }

}
